import { RouterModule, Routes } from '@angular/router'

import { MineComponent } from './mine.component'
import { IndexComponent } from './index/index.component'
import { SettingComponent } from './setting/setting.component'
import { PersonInfoComponent } from './person-info/person-info.component'
import { PersonModifyComponent } from './person-modify/person-modify.component'
import { QrcodeComponent } from './qrcode/qrcode.component'
import { AppointComponent } from './appoint/appoint.component'
import { AppointDetailComponent } from './appoint-detail/appoint-detail.component'
import { EnrollComponent } from './enroll/enroll.component'
import { QaComponent } from './qa/qa.component'
import { CommentComponent } from './comment/comment.component'
import { CommentDetailComponent } from './comment-detail/comment-detail.component'
import { ServiceCommentComponent } from './service-comment/service-comment.component'
import { ServiceCommentDetailComponent } from './service-comment-detail/service-comment-detail.component'

import { FootprintComponent } from './footprint/footprint.component'
import { HouseLoanComponent } from './house-loan/house-loan.component'
import { TaxationComponent } from './taxation/taxation.component'
import { FeedbackComponent } from './feedback/feedback.component'
import { AgreementComponent } from './agreement/agreement.component'
import { LoanDetailComponent } from './loan-detail/loan-detail.component'

const appRoutes: Routes = [
  {
    path: '',
    component: MineComponent,
    children: [
      {
        path: '',
        children: [
          { path: '', redirectTo: 'index', pathMatch: 'full' },
          { path: 'index', component: IndexComponent, data: { title: '我的', depth: 1 } },
          { path: 'setting', component: SettingComponent, data: { title: '设置', depth: 2 } },
          { path: 'personInfo', component: PersonInfoComponent, data: { title: '个人资料', depth: 2 } },
          { path: 'personModify', component: PersonModifyComponent, data: { title: '个人资料', depth: 3 } },
          { path: 'qrcode', component: QrcodeComponent, data: { title: '我的二维码', depth: 3 } },
          { path: 'appoint', component: AppointComponent, data: { title: '我的预约', depth: 2 } },
          { path: 'appointDetail', component: AppointDetailComponent, data: { title: '预约详情', depth: 3 } },
          { path: 'serviceComment', component: ServiceCommentComponent, data: { title: '服务评价', depth: 3 } },
          {
            path: 'serviceCommentDetail',
            component: ServiceCommentDetailComponent,
            data: { title: '服务评价', depth: 4 }
          },
          { path: 'enroll', component: EnrollComponent, data: { title: '我的报名', depth: 2 } },
          { path: 'qa', component: QaComponent, data: { title: '我的问答', depth: 2 } },
          { path: 'comment', component: CommentComponent, data: { title: '我的点评', depth: 2 } },
          { path: 'commentDetail', component: CommentDetailComponent, data: { title: '点评详情', depth: 7 } },
          { path: 'footprint', component: FootprintComponent, data: { title: '我的足迹', depth: 2 } },
          { path: 'houseLoan', component: HouseLoanComponent, data: { title: '房贷计算器', depth: 2 } },
          { path: 'loanDetail', component: LoanDetailComponent, data: { title: '房贷计算器', depth: 2 } },
          { path: 'taxation', component: TaxationComponent, data: { title: '税费计算器', depth: 2 } },
          { path: 'feedback', component: FeedbackComponent, data: { title: '意见反馈', depth: 3 } },
          { path: 'agreement', component: AgreementComponent, data: { title: '房乐美用户协议', depth: 3 } }
        ]
      }
    ]
  }
]

export const router = RouterModule.forChild(appRoutes)
